package com.mooc.lib_video.ui.publish

import android.content.Intent
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.TextView
import androidx.fragment.app.Fragment
import com.mooc.lib_video.R
import com.mooc.lib_video.ui.live.LiveActivity
import com.mooc.lib_video.ui.push.LivePushActivity
import com.mooc.lib_video.ui.send.SendVideoActivity

class PublishFragment : Fragment(),View.OnClickListener {

    lateinit var rootView : View

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        rootView = inflater.inflate(R.layout.fragment_publish,container,false)
        rootView.findViewById<Button>(R.id.send_video_btn).setOnClickListener(this)
        rootView.findViewById<Button>(R.id.live_btn).setOnClickListener(this)
        rootView.findViewById<Button>(R.id.live_push_btn).setOnClickListener(this)
        return rootView
    }

    override fun onClick(v: View?) {
        when(v!!.id){
            R.id.send_video_btn->{
                startActivity(Intent(context,SendVideoActivity::class.java))
            }
            R.id.live_btn->{
                startActivity(Intent(context,LiveActivity::class.java))
            }
            R.id.live_push_btn->{
                startActivity(Intent(context,LivePushActivity::class.java))
            }
        }
    }

}